import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

export const routes: Array<RouteRecordRaw> = [
    {
        path: "/:pathMath(.*)",
        redirect: "/index"
    },
    {
        path: "/",
        component: () => import('@/layout/index.vue'),
        redirect: '/index',
        children: [
            {
                path: '/index',
                name: 'index',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: "menu.index",
                }
            },
            {
                path: '/stake',
                name: 'stake',
                component: () => import('@/views/stake/index.vue'),
                meta: {
                    title: "menu.stake",
                }
            },
            {
                path: '/website',
                name: 'website',
                component: () => import('@/views/website/index.vue'),
                meta: {
                    title: "menu.website",
                }
            },
            {
                path: '/node',
                name: 'node',
                component: () => import('@/views/node/index.vue'),
                meta: {
                    title: "menu.node",
                }
            },
            {
                path: '/swap',
                name: 'swap',
                component: () => import('@/views/swap/index.vue'),
                meta: {
                    title: "menu.swap",
                }
            },
        ]
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
